package com.fsy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fsy.entities.Report;
import com.fsy.entities.Roles;
import com.fsy.entities.Students;
import com.fsy.entities.Students_exportExcel;
import com.fsy.service.StudentsService;
import com.fsy.mapper.StudentsMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 凡凡
* @description 针对表【students】的数据库操作Service实现
* @createDate 2022-04-29 11:18:39
*/
@Service
public class StudentsServiceImpl extends ServiceImpl<StudentsMapper, Students>
    implements StudentsService{

    @Resource
    private StudentsMapper studentsMapper;

    //根据条件查询网络学生
    @Override
    public List<Students> selectAllByNetpusherIdAndIsValid(Students students) {
        students.setPage((students.getPage()-1)*students.getLimit());
        return studentsMapper.selectAllByNetpusherIdAndIsValid(students);
    }

    @Override
    public int selectCounts(Students students) {
        return studentsMapper.selectCounts(students);
    }

    @Override
    public List<Students_exportExcel> exportMember(Students students) {
        return studentsMapper.exportMember(students);
    }

    @Override
    public List<Students> selectAllByIsValidAndAskerId(Students students) {
        students.setPage((students.getPage()-1)*students.getLimit());
        return studentsMapper.selectAllByIsValidAndAskerId(students);
    }

    @Override
    public int selectStudentCount(Students students) {
        return studentsMapper.selectStudentCount(students);
    }

    @Override
    public List<Roles> getRolesByUserId(Integer userId) {
        return studentsMapper.getRolesByUserId(userId);
    }

    //统计各个咨询师负责的学生人数
    @Override
    public List<Report> askerStudentCountReport() {
        return baseMapper.askerStudentCountReport();
    }

    // 统计各个网络咨询员录入的学生人数
    @Override
    public List<Report> wlzxyStudentCountReport() {
        return getBaseMapper().wlzxyStudentCountReport();
    }

    @Override
    public List<Students_exportExcel> exportMyStudents(Students students) {
        return studentsMapper.exportMyStudents(students);
    }
}




